<?php 
	$i = 0;
	$total = count($data['places']);
	foreach ($data['places'] as $place) : 
        if (! file_exists('public/static/karaoke/'.$place['img'].'')) {
            $thumb = '/public/assets/images/no-image.jpg';
        } else {
            $thumb = '/public/static/karaoke/'. $place['img'];
        }
            
        $link = "karaoke/".$place['provinceid']."/".$place['nameid'].".html";
        
?>

	<div class="col-12 col-sm-12 col-lg-12 item <?php if ($i == $total - 1) echo 'no-border last-item'; ?>">
        <a href="/<?php echo $link; ?>">
            <img alt="<?php echo $place['name']; ?>" class="thumb" src="<?php echo $thumb; ?>">
        </a>
        
        <h2><a href="/<?php echo $link; ?>"><?php echo $place['name']; ?></a></h2>
	    <h3><?php echo $place['address']. ' ,'.$place['province'] ; ?></h3>
	    <h6><?php echo $place['phone']; ?></h6>
        
        <?php if (isset($data['cur_lat']) && $data['cur_lat']) : ?>
        <p><i class="distance-icon"></i> <?php echo $this->Places_model->distance($data['cur_lat'], $data['cur_lng'], $place['latitude'], $place['longitude']); ?> km</p>
        <?php endif; ?>
        
	</div><!--/span-->
	<div class="clearfix"></div>
<?php $i++; endforeach; ?>